package scau.erps.util;
/**
 * 金额计算器
 * @author DCJ
 * 
 */
public class CalculateAmount {
	
	/**
	 * 计算所得税
	 * @param profit
	 * @return
	 */
	public static int getTax(int profit){
		int tax = 0;
		if(profit>0){
			tax = (int) Math.floor(profit*0.3);
		}
		return tax;		
	}
	
	/**
	 * 计算延迟交货罚金
	 * @param total
	 * @return
	 */
	public static int getPenal(int total){
		int penal = (int) Math.ceil(total*0.2);
		return penal;
	}
	
	/**
	 * 计算长贷利息
	 * @param amount
	 * @return
	 */
	public static int getInterestOfLongTermLoanPerYear(int amount){
		return (int) (amount*0.10);
	}
	
	/**
	 * 计算短贷利息
	 * @param amount
	 * @return
	 */
	public static int getInterestOfShortTermLoan(int amount){
		return (int) (amount*0.05);
	}
	
	/**
	 * 计算高利贷利息
	 * @param amount
	 * @return
	 */
	public static int getInterestOfUsury(int amount){
		return (int) (amount*0.20);
	}

}
